<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript语句可以在代码块中组合在一起</title>
</head>

<body>
    <h2>JavaScript 语句</h2>
    <p>JavaScript 代码块在 { 与 } 之间编写。</p>
    <button type="button" onclick="myFunction()">点击我！</button>
    <p id="demo1"></p>
    <p id="demo2"></p>
    <script>
        function myFunction() {
            document.getElementById("demo1").innerHTML = "Hello Kitty.";
            document.getElementById("demo2").innerHTML = "How are you?";
        }
    </script>
</body>

</html>